<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Medium Editor</title>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/medium-editor@5.23.3/dist/css/medium-editor.min.css">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/medium-editor@5.23.3/dist/css/themes/default.min.css">
    <style>
        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
            margin: 0;
            padding: 24px;
            background-color: #f5f5f5;
        }
        .container {
            max-width: 1200px;
            margin: 0 auto;
            background: white;
            padding: 24px;
            border-radius: 8px;
            box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        }
        .title {
            font-size: 24px;
            font-weight: 600;
            margin-bottom: 8px;
            color: #262626;
        }
        .description {
            color: #595959;
            margin-bottom: 24px;
            line-height: 1.6;
        }
        .editor {
            border: 1px solid #d9d9d9;
            border-radius: 6px;
            padding: 12px;
            min-height: 300px;
            margin-bottom: 16px;
        }
        .btn {
            background: #1890ff;
            color: white;
            border: none;
            padding: 8px 16px;
            border-radius: 6px;
            cursor: pointer;
            font-size: 14px;
        }
        .btn:hover {
            background: #40a9ff;
        }
    </style>
</head>
<body>
    <div class="container">
        <h1 class="title">Medium Editor 富文本编辑器</h1>
        <p class="description">
            Medium Editor 是一个简洁的富文本编辑器，模仿了 Medium 网站的编辑体验。
        </p>
        
        <div class="editor" id="editor">
            <p>这是 Medium Editor 编辑器的初始内容。你可以选择文本来显示编辑工具栏。</p>
            <p>支持<strong>粗体</strong>、<em>斜体</em>、<u>下划线</u>等基本格式。</p>
        </div>
        
        <button class="btn" onclick="getContent()">获取内容</button>
    </div>

    <script src="https://cdn.jsdelivr.net/npm/medium-editor@5.23.3/dist/js/medium-editor.min.js"></script>
    <script>
        var editor = new MediumEditor('#editor', {
            toolbar: {
                buttons: ['bold', 'italic', 'underline', 'anchor', 'h2', 'h3', 'quote']
            },
            placeholder: {
                text: '请输入内容...',
                hideOnClick: true
            }
        });

        function getContent() {
            var content = editor.getContent();
            console.log(content);
            alert('内容已输出到控制台');
        }
    </script>
</body>
</html>